package auto.crud.controller;

import auto.crud.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/person")
public class PersonController {

    @Autowired
    private PersonService personService;

    @RequestMapping("/autoAdd")
    public String autoAdd(@RequestParam Map<String, Object> entiryMap) {
        try {
            return String.valueOf(personService.autoAdd(entiryMap));
        }catch (Exception e){
            return "false";
        }
    }

}
